#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int a,b,n,m;
  cin>>n;
  while (n)
  {
    cin>>m;
    b=0;
    while(m){
      cin>>a;
      b+=a;
      m--;
    }
    cout<<b<<endl<<' '<<endl;
    n--;
  } 
}